package com.ruoyi.market.service.impl;

import com.ruoyi.market.domain.ConfigMessage;
import com.ruoyi.market.mapper.ConfigMessageMapper;
import com.ruoyi.market.service.IConfigMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 店铺消息配置 业务层处理
 * 
 * @author ruoyi
 */
@Service
public class ConfigMessageServiceImpl implements IConfigMessageService
{

    @Autowired
    private ConfigMessageMapper configMessageMapper;

    /**
     * 根据条件分页查询店铺消息配置列表
     * 
     * @param configMessage 店铺消息配置信息
     * @return 店铺消息配置信息集合信息
     */
    @Override
    public List<ConfigMessage> selectConfigMessageList(ConfigMessage configMessage)
    {
        return configMessageMapper.selectConfigMessageList(configMessage);
    }

    /**
     * 通过店铺消息配置ID查询店铺消息配置
     * 
     * @param shopId 店铺ID
     * @return 店铺消息配置对象信息
     */
    @Override
    public ConfigMessage selectConfigMessageByShopId(String shopId)
    {
        return configMessageMapper.selectConfigMessageByShopId(shopId);
    }

    /**
     * 新增保存店铺消息配置信息
     * 
     * @param configMessage 店铺消息配置信息
     * @return 结果
     */
    @Override
    @Transactional
    public int insertConfigMessage(ConfigMessage configMessage)
    {
        // 新增店铺消息配置信息
        int rows = configMessageMapper.insertConfigMessage(configMessage);
        return rows;
    }

    /**
     * 修改保存店铺消息配置信息
     * 
     * @param configMessage 店铺消息配置信息
     * @return 结果
     */
    @Override
    @Transactional
    public int updateConfigMessage(ConfigMessage configMessage)
    {
        return configMessageMapper.updateConfigMessage(configMessage);
    }

    /**
     * 批量删除店铺消息配置信息
     * 
     * @param configMessageIds 需要删除的店铺消息配置ID
     * @return 结果
     */
    @Override
    @Transactional
    public int deleteConfigMessageByIds(Long[] configMessageIds) { return configMessageMapper.deleteConfigMessageByIds(configMessageIds); }
}
